---
id: 6569b0a63423f65dd30888df
title: 19° passo
challengeType: 20
dashedName: step-19
---

# --description--

Remove the `pass` keyword. For the `while` loop's code block, assign `left_part[left_array_index]` to `array[sorted_index]`.

# --hints--

You should have `array[sorted_index] = left_part[left_array_index]` in the body of the loop. Don't forget to remove the `pass` keyword in the body of the loop.

```js
({
  test: () => {
    const transformedCode = code.replace(/\r/g, "");
    const merge_sort = __helpers.python.getDef("\n" + transformedCode, "merge_sort");
    const { function_body } = merge_sort;

    assert.match(function_body, /while\s+left_array_index\s*<\s*len\(\s*left_part\s*\):[^}]*\barray\s*\[\s*sorted_index\s*\]\s*=\s*left_part\s*\[\s*left_array_index\s*\]/);
  }
})
```

You should not have `pass` in the `while` loop.

```js
({
  test: () => {
    const transformedCode = code.replace(/\r/g, "");
    const merge_sort = __helpers.python.getDef("\n" + transformedCode, "merge_sort");
    const { function_body } = merge_sort;

    assert.match(function_body, /while\s+left_array_index\s*<\s*len\(\s*left_part\s*\):(?:(?!\bpass\b)[^}])*\barray\s*\[\s*sorted_index\s*\]\s*=\s*left_part\s*\[\s*left_array_index\s*\]/);
  }
})
```

# --seed--

## --seed-contents--

```py
def merge_sort(array):

    middle_point = len(array) // 2
    left_part = array[:middle_point]
    right_part = array[middle_point:]

    merge_sort(left_part)
    merge_sort(right_part)

    left_array_index = 0
    right_array_index = 0
    sorted_index = 0

    while left_array_index < len(left_part) and right_array_index < len(right_part):
        if left_part[left_array_index] < right_part[right_array_index]:
            array[sorted_index] = left_part[left_array_index]
            left_array_index += 1
        else:
            array[sorted_index] = right_part[right_array_index]
            right_array_index += 1
        sorted_index += 1

--fcc-editable-region--
    while left_array_index < len(left_part):
        pass
--fcc-editable-region--
```
